$j("#carousel-demo5 .sliderkit-nav .sliderkit-nav-clip").css("width","1400px");
$j("#standardPhotosgallery1 .sliderkit-nav .sliderkit-nav-clip ul li").css("width","57px");
$j("#standardPhotosgallery1 .sliderkit-nav .sliderkit-nav-clip ul li").css("height","85px");

$j(document).ready(function() {
    //dialog
	$j('a.login-window').click(function() {
			
			// Getting the variable's value from a link 
			var loginBox = $j(this).attr('href');
	
			//Fade in the Popup and add close button
			$j(loginBox).fadeIn(300);
			
			//Set the center alignment padding + border
			var popMargTop = ($j(loginBox).height() + 24) / 2; 
			var popMargLeft = ($j(loginBox).width() + 24) / 2; 
			
			$j(loginBox).css({ 
				'margin-top' : -popMargTop,
				'margin-left' : -popMargLeft
			});
			
			// Add the mask to body
			$j('body').append('<div id="mask"></div>');
			$j('#mask').fadeIn(300);
		
		
			return false;
		});
	
		// When clicking on the button close or the mask layer the popup closed
		$j('a.close').live('click', function() { 
		  $j('#mask , .login-popup').fadeOut(300 , function() {
			$j('#mask').remove();  
		}); 
		return false;
		});
		$j('a.close').live('click', function() { 
		  $j('#mask , .dialog-popup').fadeOut(300 , function() {
			$j('#mask').remove();  
		}); 
		return false;
		});
		$j('a.close, .removes').live('click', function() { 
		  $j('#mask , .quick-popup').fadeOut(300 , function() {
			$j('#mask').remove();  
		}); 
		return false;
		});
		
		//close box lua chon dang ky
		$j('a.luachon-close').live('click', function() { 
		  $j('#mask , .login-popup').fadeOut(300 , function() {
			$j('#mask').remove();  
		}); 
		return false;
		});	
	
		// len dau trang
		$j("#back-top").hide();
		// fade in #back-top
		$j(function () {
			$j(window).scroll(function () {
				if ($j(this).scrollTop() > 100) {
					$j('#back-top').fadeIn();
				} else {
					$j('#back-top').fadeOut();
				}
			});
	
			// scroll body to 0px on click
			$j('#back-top a').click(function () {
				$j('body,html').animate({
					scrollTop: 0
				}, 800);
				return false;
			});
		});
	
	//hien like
	
	  $j('.anh-ghrss').click(function(){
		 $j('.anh-ghrss').hide();
		 $j('.anh-ghrs').show();
	     });
		 $j('.anh-ghrs').click(function(){
		 $j('.anh-ghrs').hide();
		 $j('.anh-ghrss').show();
	   });
	   
		$j('.thongbao-window').click(function(){
		 $j('.thongbao-popup').show();
	   });
	   $j('.thongbao-close').click(function(){
		 $j('.thongbao-popup').hide();
	   });
   
  
  //  hai anh active menu
	  $j(".nav-account a").click(function () {
		$j(".selected_tab").removeClass("selected_tab").addClass('unselect_tab');
		$j(this).parent().addClass("selected_tab").removeClass('unselect_tab');
		$j(".account").slideUp();
		var content_show = $j(this).attr("title");
		$j("."+content_show).slideDown();
	  }); 
	   
   
   
 }); 



/// hovermenu 
$j(function(){
	$j('li').hover(function() {
		$j('#tuansd').addClass("tuans");
		id = $j(this).attr('id');
		var $li = $j(this);
		$j.ajax({
			type: "POST",
			url: "php.php",
			data: 'hovered_id='+id,
			success:function(data){
			  $j('.result').html(data);
			  
			}
		});
	},function(){
		  $j('#tuansd').removeClass("tuans");
		//Hover-out function
		//Clear your div, or some such
		$li.find('.result').html('');
	});
});

window.onload = window.onresize=function(){		
	var h = $j("#all").css("width");
	// slide chi tiet
				$j("#standardPhotosgallery").sliderkit({
					mousewheel:true,
					shownavitems:7,
					//navfx:"none",
					panelbtnshover:true,
					auto:true,
					circular:true,
					navscrollatend:true,
					counter:true
				});
				
				
				$j("#standardPhotosgallery1").sliderkit({
					mousewheel:true,
					shownavitems:7,
					//navfx:"none",
					panelbtnshover:true,
					auto:true,
					circular:true,
					navscrollatend:true,
					counter:true
				});
				
	if ( parseInt(h) > 1280)
	{
		// slide cuoi
		$j("#carousel-demo5").sliderkit({
			auto:false,
			autospeed:4000,
			shownavitems:6,
			circular:true,
			fastchange:true,
			scrolleasing:"easeOutExpo", //"easeOutBounce, easeOutBack"
			scrollspeed:300
		});	
				
		
		$j("#contentall").css("width","1252px");
		$j(".noidung-fter").css("width","1252px");
		$j("#nd-topall").css("width","1252px");
		$j("#menu-item2").css("width","987px");
		$j(".menu-item2 ul li").css("width","163.5px");
		$j(".menu-duoi ul li").css("min-width","173.8px");
		$j(".splon").css("width","604px");
		$j(".list-sp").css("width","997px");
		$j(".timkiem").css("width","305px");
		$j(".quangcao1 img").css("width","97.7%");
		$j(".list-sp .spnhodlich").css("width","483.5px");
		$j(".list-sp .spnhodlich").css("height","auto");
		$j(".thichsp .listspthich").css("width","595px");
		$j(".box-listthich ul li .anhsps img").css("width","271px");
	    
		$j("#list").css("margin-left","56px");
		$j("#list").css("margin-right","56px");
		$j(".prev").css("padding-left","15px");
		$j(".next").css("padding-right","15px");
		$j(".prev img").css("width","26px");
		$j(".next img").css("width","26px");
		$j(".list-sphh .spnho").css("width","404px");
		$j(".list-sphh .tuan").css("height","237px");
		$j(".list-sphh .tuan43").css("top","-23px");
		$j(".list-sphh .tuan43").css("left","47px");
		$j(".list-sphh .tuan34").css("top","-23px");
		$j(".list-sphh .tuan34").css("left","7px");
		$j(".list-sphh .tuan1").css("top","105px");
		$j(".list-sphh .tuan1").css("left","145px");
		$j(".splon .anh-ghrss").css("bottom","5px");
		$j(".splon .anh-ghrs").css("bottom","5px");
		$j(".hover-duoi").css("height","240px");
		$j(".splonhh").removeClass("splonhh").addClass("splonhh1");
		$j(".baongoai").css("width","1134px");
        $j(".baongoai").css("left","60px");
		
		$j(".detail-123").css("width","982px");
		$j(".container").css("width","1252px");
		$j(".detail2").css("width","775px");
		$j("#title").css("width","590px"); 
		$j(".box-bestseller").css("width","220px"); 
		$j(".quickbox").css("width","1252px");
		
		$j(".content-account").css("width","940px"); 
		$j(".footerv2").css("width","1252px");
		$j(".diachi").css("width","942px");
		$j(".footer-danhmuc").css("width","914px");
		$j(".iconfooter").css("width","904px");
			}

	
	else
	{
    // slide cuoi
		$j("#carousel-demo5").sliderkit({
						auto:true,
						autospeed:4000,
						shownavitems:5,
						circular:true,
						fastchange:true,
						scrolleasing:"easeOutExpo", //"easeOutBounce, easeOutBack"
						scrollspeed:300
		 });
		 	
		$j("#contentall").css("width","1003px");
		$j(".noidung-fter").css("width","1003px");
		$j("#nd-topall").css("width","1003px");
		$j("#menu-item2").css("width","739px");
		$j(".menu-item2 ul li").css("width","122px");
		$j(".menu-duoi ul li").css("min-width","138px");
		$j(".splon").css("width","479px");
		$j(".list-sp").css("width","764px");
		$j(".timkiem").css("width","275px");
		$j(".quangcao1 img").css("width","97%");
		$j(".list-sp .spnhodlich").css("width","361px");
		$j(".list-sp .spnhodlich").css("height","223px");
		$j(".thichsp .listspthich").css("width","465px");
		$j(".box-listthich ul li .anhsps img").css("width","145px");
		$j(".list-sphh .spnho").css("width","321px");
		$j(".list-sphh .tuan").css("height","188px");
		$j(".list-sphh .tuan43").css("top","-23px");
		$j(".list-sphh .tuan43").css("left","47px");
		$j(".list-sphh .tuan34").css("top","-23px");
		$j(".list-sphh .tuan34").css("left","7px");
		$j(".list-sphh .tuan1").css("top","105px");
		$j(".list-sphh .tuan1").css("left","100px");
		$j(".splon .anh-ghrss").css("bottom","5px");
		$j(".splon .anh-ghrs").css("bottom","5px");
		$j(".splonhh1").removeClass("splonhh1").addClass("splonhh");
		$j(".hover-duoi").css("height","180px");
		$j(".detail-123").css("width","734px");
		$j(".container").css("width","1003px");
		$j(".baongoai").css("width","939px");
		$j(".baongoai").css("left","32px");
		
		$j(".detail2").css("width","525px");
		
		$j("#title").css("width","374px"); 
		$j(".box-bestseller").css("width","220px");
		$j(".quickbox").css("width","1003px");
		
		$j(".content-account").css("width","700px");
		$j(".footerv2").css("width","1003px");
		$j(".diachi").css("width","702px");
		$j(".footer-danhmuc").css("width","683px");
		$j(".iconfooter").css("width","656px");
		
		
		
	}
	  }
	 
	 
	 
	 
	
	
	
	
	

	 
	 
	 
	